package com.funwell.server.base;

import com.alibaba.fastjson.annotation.JSONField;
import com.funwell.server.constants.SysModuleEnum;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.xml.bind.ValidationException;
import java.io.Serializable;

/**
 * 基础类，所有的实体类必须基础此类
 * 
 * 简单基础类，只有id
 * @author fulei
 *
 */
public class SimpleBaseEntity implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @JSONField(serialize = false)
    public static SysModuleEnum getModule() throws ValidationException {
        throw new ValidationException("谁没有再model中重写getModule方法");
    }

    @Id
    @Column(name = "`id`")
    private String id;
    /**
     * 是否有效
     */
    @Column(name = "`enabled`")
    private Boolean enabled;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @JSONField(serialize = false)
    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
}